package com.cjw.mapper.soulread;

import com.cjw.pojo.entity.soulread.Read;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.special.InsertUseGeneratedKeysMapper;

import java.util.Date;
import java.util.List;

/**
 * @create_time: 2021.12.30
 * @author : cjw
 */
@Repository
public interface ReadMapper extends Mapper<Read>, InsertUseGeneratedKeysMapper<Read> {
    List<Read> findAll(@Param("begin") Integer begin, @Param("size") Integer size, @Param("find") String find, @Param("tagId") Long tagId);

    List<Read> findAllMyRead(@Param("begin") Integer begin, @Param("size") Integer size, @Param("find") String find, @Param("userId") Long userId);

    Integer findAllTotal(@Param("find") String find, @Param("tagId") Long tagId);

    Integer findCountByDate(@Param("date") Date date);

    List<Read> findAllHeat();
}
